type NameList = {
  name: string
}
export const axios = (url: string): Promise<NameList[]> => {
  return new Promise(resolve => {
    let xhr: XMLHttpRequest = new XMLHttpRequest();
    xhr.open('GET', url);
    xhr.send(null);
    xhr.onreadystatechange = function () {
      if (xhr.status === 200 && xhr.readyState === 4) {
        setTimeout(() => {
          console.log('sucess:', xhr.responseText);
          resolve(JSON.parse(xhr.responseText));
        }, 3000);
      }
    }
  })
}